package org.mpd.amobilempd.network;

import java.util.ArrayList;
import java.util.List;

public class MPDAlbum {
	private String name;
	private String artist;
	private List<MPDTrack> tracks;
		
	public MPDAlbum(String name) {
		this.name = name;
		tracks = new ArrayList<MPDTrack>();
	}
	
	public String getName() { return name; }
	public String getArtist() { return artist; } 
	
//	public List<MPDTrack> getTracks() { return tracks; }
	
	public int getTrackCount() { return tracks.size(); }
	
	public void addTrack(MPDTrack track) {
		tracks.add(track);
	}
	
	public MPDTrack getTrackAt(int position) throws IndexOutOfBoundsException 
	{
		if(position<tracks.size()){
			return tracks.get(position);
		}
		else {
			throw new IndexOutOfBoundsException();
		}
	}
	
}
